﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>东晨皇玺平台-资讯</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--标准mui.css-->
    <link rel="stylesheet" href="../css/mui.min.css">

    <!--App自定义的css-->
    <!--<link rel="stylesheet" type="text/css" href="../css/app.css"/>-->
    <style>
        li{ list-style:none; }
    </style>

</head>
<body style="overflow-x:hidden">
<div class="mui-content"  style="margin-bottom: 50px;">
    <div class="headage"></div>            
    <div class="mui-content-padded"  id="chente" style="width: 100%;">

    </div>
	 


    <div class="footerpage">
    </div>
</div>

</body>
<script src="../js/mui.min.js"></script>
<script src="../js/practise/push.js"></script>
<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/cookieutil.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/getUrlParam.js"></script>
<script src="../js/page/getuserBylogin.js"></script>
<script type="text/javascript" src="../js/jweixin-1.4.0.js"></script>
<script>
    $(function(){

        /*公共部分
         * 导航栏
         * footer CopyRight
         */


        $(".headage").load("head.html");
        $(".footerpage").load("footer.html");
        var id=getUrlParam("id");
        var upid=getUrlParam("upopenid");
        var  userid=getCookie('userid');
        if (userid==""||userid==null||userid==undefined) {
            userid="";
        }
        var  upopenid=getCookie('upopenid');
        if(upopenid==""||upopenid==null||upopenid==undefined){upopenid=="";}
        var  level=getCookie('level');
        console.log("用户等级："+level+"对应关系"+getusertypedata(level))
        var url;
        if (level=='0'||level=="1") {
            console.log("我是粉丝");
             url = encodeURI("http://qb.kmhkj.top/view/addetails.html?id=" + id + "&upopenid=" + upopenid);
        }
        else {
            console.log("我是一级，后续，加盟");
            url = encodeURI("http://qb.kmhkj.top/view/addetails.html?id=" + id + "&upopenid=" + userid);
        }
        console.log(url);
        var  url2=location.href.split('#')[0];
        function getwxconfing(title,pretext,preimage){
            mui.post('/wxpya/getWxConfig',
                {
                    url:url2
                },
                function (data) {
                    console.log(url);
                    console.log(data);
                    if (data!=undefined) {
                        wx.config({
                            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                            appId: data.appId, // 必填，公众号的唯一标识
                            timestamp: data.timestamp, // 必填，生成签名的时间戳
                            nonceStr: data.nonceStr, // 必填，生成签名的随机串
                            signature: data.signature,// 必填，签名
                            jsApiList: [//需要调用的JS接口列表
                                'checkJsApi',//判断当前客户端版本是否支持指定JS接口
                                'onMenuShareAppMessage',//分享给好友
                                'onMenuShareTimeline'//分享到朋友圈
                            ]
                        });
                        var config = {
                            title: title, // 分享标题
                            desc: pretext, // 分享描述
                            link: url, // 分享链接
                            imgUrl: imgsrcpath()+preimage,
                            success: function () { /*$.alert("成功分享");*/ },
                            cancel: function () { /*$.alert("分享失败,您取消了分享!");*/ }
                        };
                        wx.ready(function () {
                            wx.onMenuShareAppMessage(config);
                            wx.onMenuShareTimeline(config);
                        });
                    }
                }, 'json'
            )
        }
        mui.post('/Article/findid',
            {
                id:id,
                upopenid:upid,
                userid:userid
            },
            function(data){
                geturlid();
                console.log(data);
                if (data.code&&data.object!=null){
                    var x = document.getElementById("chente");
                    x.innerHTML = data.object.content;//改变内容
                    getwxconfing(data.object.title,data.object.pretext,data.object.preimage);
                    // var x2 = document.getElementById("chente").innerText;
                    // x.innerHTML = x2;//改变内容
                }
            },'json'
        );
    });
</script>
</html>